<!-- 开放管理-数据分析-实验室利用率 -->
<template>
  <div class="JNPF-common-layout">
    <div class="JNPF-common-layout-center">
      <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>

          <el-col :span="10">
            <el-form-item label="日期">
              <el-date-picker v-model="fbillcredate" type="daterange" value-format="yyyy-MM-dd" range-separator="至"
                start-placeholder="开始日期" end-placeholder="结束日期">
              </el-date-picker>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="场地名称">
              <el-input v-model="listQuery.fuser" placeholder="请输入场地名称" clearable />
            </el-form-item>
          </el-col>

          <template v-if="showAll">
          <el-col :span="6">
            <el-form-item label="所属教学楼">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="所属楼层">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options2"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

        </template>

          <el-col :span="6">
            <el-form-item label="">
              <el-button type="primary" icon="el-icon-search" >查询</el-button>
              <!-- <el-button type="primary" icon="el-icon-plus" @click="insert(undefined)">新增</el-button> -->
              <el-button type="danger" icon="el-icon-download">导出</el-button>
              <el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">展开</el-button>
              <el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>收起</el-button>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <div class="JNPF-common-layout-main JNPF-flex-main">
        <JNPF-table :data="list" border v-loading="loading">
          <el-table-column prop="FGRAND" label="所属教学楼" ></el-table-column>
          <el-table-column prop="FLEVEL" label="所属楼层" ></el-table-column>
          <el-table-column prop="FPOINT" label="场所名称" ></el-table-column>
          <el-table-column prop="FUSEDAY1" label="可用天数" width="95"></el-table-column>
          <el-table-column prop="FUSEDAY2" label="使用天数" width="95"></el-table-column>
          <el-table-column prop="FUSERATE" label="使用率" width="95"></el-table-column>
          <el-table-column prop="FUSETIME1" label="可用时间" width="95"></el-table-column>
          <el-table-column prop="FUSETIME2" label="使用时间" width="95"></el-table-column>
          <el-table-column prop="FTIMERATE" label="牛马率" width="95"></el-table-column>
        </JNPF-table>
        <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"/>
      </div>
    </div>
  </div>
</template>
<script>
  import jnpf from "@/utils/jnpf"
  export default {
    name: 'shop',
    components: {  },
    data() {
      return {
        showAll: false,

        //所属教学楼选择数据
        options1: [{
          value: '20E01',
          label: '第一教学楼'
        }, {
          value: '20E02',
          label: '第二教学楼'
        }, {
          value: '20N03',
          label: '化学楼'
        }, {
          value: '20E04',
          label: '综合实验楼'
        }],

        //所属楼层选择数据
        options2: [{
          value: '20E01',
          label: '一楼'
        }, {
          value: '20E02',
          label: '二楼'
        }, {
          value: '20N01',
          label: '三楼'
        }, {
          value: '20N02',
          label: '四楼'
        }],

        customlist:[
          {
            "FBILLNO": "K241130001", 
            "FBILLCREDATE":"2024-11-30",
            "FUSER": "曹操",
            "FMEMO": "有机化学实验操作课",
            "FBEGDATE": "2024-12-01",
            "FENDDATE": "2025-11-30",
            "FCHECKUSE": "",
            "FCHECKDATE": "",
            "FNOTE":"",
            "FBILLSTATE": "申请中"
          },
        ],
        list: [
            {
              "FGRAND":"第一教学楼",
              "FLEVEL":"一楼",
              "FPOINT":"奉1教楼101",
              "FUSEDAY1":"22",
              "FUSEDAY2":"18",
              "FUSERATE":"81.8%",
              "FUSETIME1":"176",
              "FUSETIME2":"132",
              "FTIMERATE":"75%"
            },{
              "FGRAND":"第一教学楼",
              "FLEVEL":"一楼",
              "FPOINT":"奉1教楼102",
              "FUSEDAY1":"22",
              "FUSEDAY2":"20",
              "FUSERATE":"90.9%",
              "FUSETIME1":"176",
              "FUSETIME2":"156",
              "FTIMERATE":"86.9%"
            },
            ,{
              "FGRAND":"综合实验楼",
              "FLEVEL":"二楼",
              "FPOINT":"奉综教楼201",
              "FUSEDAY1":"22",
              "FUSEDAY2":"22",
              "FUSERATE":"100%",
              "FUSETIME1":"176",
              "FUSETIME2":"176",
              "FTIMERATE":"100%"
            },{
              "FGRAND":"综合实验楼",
              "FLEVEL":"二楼",
              "FPOINT":"奉综教楼202",
              "FUSEDAY1":"22",
              "FUSEDAY2":"16",
              "FUSERATE":"72.7%",
              "FUSETIME1":"176",
              "FUSETIME2":"132",
              "FTIMERATE":"64.8%"
            },
        ],
        fbillcredate: [jnpf.dateFormat(new Date(), "YYYY-MM-DD"), jnpf.dateFormat(new Date(), "YYYY-MM-DD")],
        loading: false,
        total: 0,
        listQuery: {
          page: 1,
          limit: 20,
          sort: "desc",
          sidx: "",
          fbillstate: "",
          fbillno: "",
          begindate: undefined,
          enddate: undefined,
          fcustomno: ""
        },
      };
    },
    computed: {},
    methods: {
    },
  };
</script>